import { Component, OnInit } from '@angular/core';
import { AlarmService } from 'app/pages/traffic-management/traffic-alert/alarm.service';

@Component({
    selector: 'itmp-operational-alarm',
    templateUrl: './operational-alarm.component.html',
    styleUrls: ['./operational-alarm.component.css']
})
export class OperationalAlarmComponent implements OnInit {
    pagination = {
        totalEle: 25,
        pageSize: 10,
        currentPage: 1,
        currentSize: 10
    };
    totalEle = 0;
    listOfData = [];
    renderHeader: any = [];
    toolbarList = [
        { className: 'icon-yanjing-shi' },
        { className: 'icon-dayinfuyin-' },
        { className: 'icon-screenfull' },
        { className: 'icon-xiazai' }
    ];
    constructor(private alarmService: AlarmService) {}

    ngOnInit() {
        this.renderHeader = this.alarmService.renderHeader();
        this.listOfData = this.alarmService.generateEvents(10);
    }
    // page change
    onPageChange(e) {
        this.pagination.currentPage = e;
    }

    onSizeChange(e) {
        this.pagination.currentSize = e;
    }
}
